<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8"/>
    <link rel="icon" type="image/png" th:href="@{/img/favicon.ico}">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title>宠物管理系统</title>
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport'/>
    <meta name="viewport" content="width=device-width"/>
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/animate.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/light-bootstrap-dashboard.css}" rel="stylesheet"/>
</head>
<body>

<div class="wrapper">
    <div class="sidebar" data-color="blue" data-image="static/img/sidebar-5.jpg">
        <div class="sidebar-wrapper">
            <div class="logo">
                <a th:href="@{/}" class="simple-text">
                    首页
                </a>
            </div>

            <ul class="nav">
                <li class="active">
                    <a th:href="@{/getAllPet}">
                        <i class="pe-7s-note2"></i>
                        <p>宠物</p>
                    </a>
                </li>
            </ul>
        </div>
    </div>

    <div class="main-panel">
        <nav class="navbar navbar-default navbar-fixed">
            <div class="container-fluid">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse"
                            data-target="#navigation-example-2">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">宠物管理系统</a>
                </div>
                <div class="collapse navbar-collapse">
                    <ul class="nav navbar-nav navbar-left">
                        <li>
                            <a href="#">
                                <i class="fa fa-search"></i>
                                <p class="hidden-lg hidden-md">Search</p>
                            </a>
                        </li>
                    </ul>

                    <ul class="nav navbar-nav navbar-right">
                        <li>
                            <a href="#">
                                <p>登陆</p>
                            </a>
                        </li>

                        <li>
                            <a href="#">
                                <p>注销</p>
                            </a>
                        </li>
                        <li class="separator hidden-lg hidden-md"></li>
                    </ul>
                </div>
            </div>
        </nav>
        <form th:action="@{/Edit}" method="post">
            <input type="hidden" name="id" th:value="${pt.getId()}">
            <div class="form-group">
                <h4><label>name</label></h4>
                <input th:value="${pt.getName()}" type="text" name="name" class="form-control" placeholder="name">
            </div>
            <div class="form-group">
                <h4><label>birthDate</label></h4>
                <input th:value="${#dates.format(pt.getBirthDate(),'yyyy-MM-dd HH:mm:ss')}" type="text" name="birthDate"
                       class="form-control" placeholder="格式：年-月-日">
            </div>
            <div class="form-group">
                <h4><label>type</label></h4>
                <select class="form-control" name="type">
                    <option th:selected="${type.getId()==pt.getType().getId()}" th:each="type:${types}"
                            th:text="${type.getName()}" th:value="${type.getId()}"></option>
                </select>
            </div>
            <div class="form-group">
                <h4><label>owner</label></h4>
                <select class="form-control" name="owner">
                    <option th:selected="${owner.getId()==pt.getOwner().getId()}" th:each="owner:${owners}"
                            th:text="${owner.getFirstName()}" th:value="${owner.getId()}"></option>
                </select>
            </div>
            <button type="submit" class="btn btn-primary">提交</button>
        </form>
    </div>
</div>

<footer class="footer">
    <div class="container-fluid">
        <p class="copyright pull-right">
            &copy;
            <script>document.write(new Date().getFullYear())</script>
            <a href="#">Creative
                long</a>, made with love for a better web
        </p>
    </div>
</footer>
</div>
</div>
</body>
<script th:src="@{/js/jquery.3.2.1.min.js}" type="text/javascript"></script>
<script th:src="@{/js/bootstrap.min.js}" type="text/javascript"></script>
</html>